package com.sl.biz.modular.cdc.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sl.biz.modular.cdc.dao.domain.entity.CdcDatabaseConfigDO;
import com.sl.biz.modular.cdc.dao.mapper.CdcDatabaseConfigMapper;
import com.sl.biz.modular.cdc.dao.service.CdcDatabaseConfigDaoService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CdcDatabaseConfigDaoServiceImpl extends ServiceImpl<CdcDatabaseConfigMapper, CdcDatabaseConfigDO> implements CdcDatabaseConfigDaoService {
    @Override
    public List<CdcDatabaseConfigDO> queryByCdcIds(List<String> cdcConfigId) {
        LambdaQueryWrapper<CdcDatabaseConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.in(CdcDatabaseConfigDO::getCdcId, cdcConfigId);
        return super.list(lambdaQueryWrapper);
    }

    @Override
    public Boolean removeByCdcId(String cdcId) {
        LambdaQueryWrapper<CdcDatabaseConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CdcDatabaseConfigDO::getCdcId, cdcId);
        return super.remove(lambdaQueryWrapper);
    }

    @Override
    public List<CdcDatabaseConfigDO> queryByCdcId(String cdcId) {
        LambdaQueryWrapper<CdcDatabaseConfigDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CdcDatabaseConfigDO::getCdcId, cdcId);
        return super.list(lambdaQueryWrapper);
    }
}
